消减整数
import java.util.;

public class Main{
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int t = in.nextInt();
        while(t--  0) {
            int h = in.nextInt();
            int tmp = 1;
            int count = 1;
            h--;
            while (h != 0) {
                if (h % (2tmp) == 0) {
                    h -= 2tmp;
                    count++;
                    tmp = 2;
                } else {
                    count++;
                    h -= tmp;
                }
            }
            System.out.println(count);
        }
    }
}